import request from "@/utils/request";

// 获取系统文章列表
export function getAgreementApi(query) {
  return request({
    url: "/system/article/list",
    method: "get",
    params: query,
  });
}

// 获取系统文章列表分类
export function getClassifyApi(query) {
  return request({
    url: "/system/classify/list",
    method: "get",
    params: query,
  });
}

// 新增系统文章
export function addAgreementApi(data) {
  return request({
    url: "/system/article/add",
    method: "post",
    data: data,
  });
}

// 根据系统文章id获取详细信息
export function getAgreementByIdApi(postId) {
  return request({
    url: "/system/article/" + postId,
    method: "get",
  });
}

// 修改系统文章
export function updateAgreementApi(data) {
  return request({
    url: "/system/article/edit",
    method: "put",
    data: data,
  });
}

// 启用/禁用系统文章
export function updateEnableApi(data) {
  return request({
    url: "/system/article/changeEnable",
    method: "put",
    data: data,
  });
}

// 删除系统文章
export function delAgreementApi(postId) {
  return request({
    url: "/system/article/remove/" + postId,
    method: "delete",
  });
}
